package com.google.project.server.entity;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.project.shared.SpecializeDTO;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Specialize implements Serializable{
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;
	
	@Persistent
	private String specializeName;
	
	@Persistent
	private String description;
	public Specialize() {
	}
	
	public Specialize(SpecializeDTO specializeDTO) {
		this.specializeName = specializeDTO.getSpecializeName();
		this.description=specializeDTO.getDescription();
	}
	public void updateFromDTO(SpecializeDTO specializeDTO) {
		this.specializeName =specializeDTO.getSpecializeName();
		this.description=specializeDTO.getDescription();
	}
	public SpecializeDTO toDTO() {
		SpecializeDTO data = new SpecializeDTO();
		data.setId(id);
		data.setSpecializeName(specializeName);
		data.setDescription(description);
		return data;
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSpecializeName() {
		return specializeName;
	}

	public void setSpecializeName(String specializeName) {
		this.specializeName = specializeName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
}
